package com.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.entity.EquipmentData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 设备数据表 Mapper 接口
 * </p>
 *
 * @author 马磊
 * @since 2023-02-02
 */
@Mapper
public interface EquipmentDataMapper extends BaseMapper<EquipmentData> {

    @Select("select * from tb_equipment_data where time_stamp = " +
            "(select max(time_stamp) from tb_equipment_data group by equipment_id)")
    List<EquipmentData> selectExportData();
}
